package com.example.xyxwebbackend001.model.DTO;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

// 基础内容块
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = false)
@JsonSubTypes({
        @JsonSubTypes.Type(value = HeadingBlockDTO.class, name = "heading"),
        @JsonSubTypes.Type(value = ParagraphBlockDTO.class, name = "paragraph"),
        @JsonSubTypes.Type(value = ListBlockDTO.class, name = "list"),
        @JsonSubTypes.Type(value = ImageBlockDTO.class, name = "image"),
        @JsonSubTypes.Type(value = VideoBlockDTO.class, name = "video")
})
public abstract class ContentBlockDTO {
    @JsonProperty("type")
    public abstract String getType();
}